package com.xxxx.web.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xxxx.web.dto.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 盘点明细表表
 */
@Data
@TableName("`InventoryCheckDet`")
public class InventoryCheckDet extends BaseEntity {


    /**
     * 仓库
     */
    @JsonProperty("WarehouseId")
    @TableField(value = "WarehouseId", updateStrategy = FieldStrategy.IGNORED)
    private Integer WarehouseId;

    /**
     * 库位
     */
    @JsonProperty("WarehouseBinId")
    @TableField(value = "WarehouseBinId", updateStrategy = FieldStrategy.IGNORED)
    private Integer WarehouseBinId;

    /**
     * 盘点单
     */
    @JsonProperty("InventoryCheckId")
    @TableField(value = "InventoryCheckId", updateStrategy = FieldStrategy.IGNORED)
    private Integer InventoryCheckId;

    /**
     * 数量
     */
    @JsonProperty("Qty")
    @TableField(value = "Qty", updateStrategy = FieldStrategy.IGNORED)
    private Double Qty;

    /**
     * 商品
     */
    @JsonProperty("CargoId")
    @TableField(value = "CargoId", updateStrategy = FieldStrategy.IGNORED)
    private Integer CargoId;

    /**
     * 把盘点明细表实体转换成盘点明细表传输模型
     */
    public InventoryCheckDetDto MapToDto() throws InvocationTargetException, IllegalAccessException {
        InventoryCheckDetDto InventoryCheckDetDto = new InventoryCheckDetDto();

        BeanUtils.copyProperties(InventoryCheckDetDto, this);

        return InventoryCheckDetDto;
    }

}
